package com.cruise.system.userhandle.controller;

import com.cruise.common.redis.helper.RedisHelper;
import com.cruise.system.userapi.entity.SysUser;
import com.cruise.system.userhandle.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 类名：HelloController
 * 描述：TODO
 * @author cruise
 * 日期：2021/1/16 上午12:08
 * 版本：1.0
 **/

@Api(tags = "系统测试接口")
@RestController
@RequestMapping("/sysuser")
public class HelloController {

    @Resource
    private RedisHelper redisHelper;

    @Resource
    private SysUserService sysUserService;

    @ApiOperation("查询系统用户")
    @GetMapping("/getSysUser")
    public SysUser getSysUser(Integer userId){

        SysUser sysUser = sysUserService.getById(userId);

        System.out.println(sysUser);

        redisHelper.set("testSysUser", sysUser.toString());
        return sysUser;
    }
}
